package com.ajk.server.dao.provider;

import org.apache.commons.lang3.StringUtils;

import com.ajk.server.model.Report;

public class ReportProvider {
	
	public String getReportList(Report report) {
		
		StringBuilder sb = new StringBuilder();
		
		sb.append("select * from t_report where 1 = 1 ");
		if(report.getUserId() != null && report.getUserId() > 0) {
			sb.append(" and user_id = #{userId} ");
		}
		if(StringUtils.isNotEmpty(report.getUserName()) ) {
			sb.append(" and user_name = #{userName} ");
		}
		sb.append(" order by id desc ");
		return sb.toString();
		
	}

}
